<?

/**
* local collection functions of tocmenu_45
*
* @author Adesanto Asman
* @version 1.0
* @license Free
* @copyright Copyright (c)2007, Adesanto Asman
* @package CLHandlers
*
*/

/**
* @package CLHandlers
*
*/
class CLHandlers{


  /**
   * insert into header
   *
   * @param Database  $Db
   * @param string    $values
   * @param string    $srcDb
   */
  function insToHdr(&$Db,
                    &$values,
                     $srcDb){

    $query	= "INSERT INTO ".$srcDb."
               (JOB_ID,
                REFERENCE,
                TR_DATE,
                NO,
                SRC_WHS,
                NOTA_SRC,
                STATUS)
               VALUES (".$values.")";

    $Db->execQuery($query);
  }

  /**
   * insert into detail
   *
   * @param Database  $Db
   * @param string    $values
   * @param string    $srcDb
   */
  function insToDtl(&$Db,
                    &$values,
                    &$isSerNumber,
                     $srcDb){

    if($isSerNumber){

      $query	= "INSERT INTO ".$srcDb."
                 (JOB_ID,
                  NO,
                  MODEL_ID,
                  QTY,
                  HEAD,
                  LENGTH,
                  SER_NUM)
                 VALUES (".$values.")";
    }else{

      $query  = "INSERT INTO ".$srcDb."
                 (JOB_ID,
                  NO,
                  MODEL_ID,
                  QTY,
                  HEAD,
                  LENGTH)
                 VALUES (".$values.")";
    }

    $Db->execQuery($query);
  }
}

?>